package engine

import (
	"gxgeek.com/gxgeek/learngo/crawler/fetcher"
	"log"
)

func Worker(request Request) (ParseResult,error){
	body, err := fetcher.Fetcher(request.Url)
	if err != nil {
		log.Printf("Fetcher error  fetcher url:%s :%v", request.Url, err)
		return ParseResult{},err
	}
	return request.Parser.Parse(body,request.Url),nil

}
